//============================================================================
// Name        : ch11ex05.cpp
// Author      : Jordan Gray
// Version     :
// Copyright   : MIT
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <assert.h>
#include "lint.h"

int main() {
  using ch11ex05::LINT;
  LINT lint1(std::list<unsigned char>(1,2), false);
  LINT lint2(lint1);
  lint1 = LINT(std::list<unsigned char>(1,1), false);
  LINT lint_temp(std::list<unsigned char>(1,3), false);
  LINT lint3;
  lint3 = lint_temp;
  LINT lint4;
  lint4 = lint3 + lint1;
  LINT lint5 = lint3;
  lint5 += lint2;

  LINT lint125 = lint5*lint5*lint5;
  lint_temp = lint125;
  lint_temp *= lint5; // 625
  lint_temp = lint_temp-lint125; // 500
  std::cout << "lint_temp: " << lint_temp << std::endl;
  lint_temp = lint_temp-lint1;
  std::cout << "lint_temp: " << lint_temp << std::endl;
  LINT lint1n = lint1 - lint2;
  LINT lint124(lint125);
  lint124 += lint1n;
  LINT lint120n = lint5 - lint125;
  std::cout << "lint1: " << lint1 << std::endl;
  std::cout << "lint2: " << lint2 << std::endl;
  std::cout << "lint3: " << lint3 << std::endl;
  std::cout << "lint4: " << lint4 << std::endl;
  std::cout << "lint5: " << lint5 << std::endl;
  std::cout << "lint125: " << lint125 << std::endl;
  std::cout << "lint124: " << lint124 << std::endl;
  std::cout << "lint1n: " << lint1n << std::endl;
  std::cout << "lint120n: " << lint120n << std::endl;
  lint_temp = lint120n+lint125;
  std::cout << "-120+125= " << lint_temp << std::endl;
  std::cout << "125-125= " << lint125-lint125 << std::endl;
  std::cout << "-120-125= " << lint120n-lint125 << std::endl;
  std::cout << "-120--120= " << lint120n-lint120n << std::endl;
  int input = 4;
  LINT result = 1;
  for(int index=0; index < input; index++) {
    result *= (index+1);
  }
  std::cout << input << "! = " << result << std::endl;
  std::cout << "125/5 = " << lint125/5 << std::endl;
  std::cout << "5/-125 = " << lint5/-125 << std::endl;
  int index = 10;
  while(index-- > 0) {
    int tmp = index;
    std::cout << tmp << std::endl;
  }
	return 0;
}
